<template>
  <el-container>
    <el-header style="height: 80px;">
      <el-row>
        <el-col :span="8">
          <img src="@/assets/logo.png" width="140px" style="padding-top:10px; padding-left:20px;">
        </el-col>
        <el-col :span="16" style="text-align: right; padding-right: 30px;">
          <el-dropdown v-if="isLogin">
            <i class="el-icon-setting" style="margin-right: 15px"></i>
            <el-dropdown-menu slot="dropdown">
              <el-dropdown-item>查看</el-dropdown-item>
              <el-dropdown-item>新增</el-dropdown-item>
              <el-dropdown-item>删除</el-dropdown-item>
            </el-dropdown-menu>
          </el-dropdown>
          <span v-if="isLogin">王小虎</span>
          <el-button @click="login" plain size="medium" v-if="!isLogin">登录</el-button>
        </el-col>
      </el-row>
    </el-header>
    <el-main>Main</el-main>
    <el-footer>&copy; 2020</el-footer>
  </el-container>
</template>

<script>
export default {
  data () {
    return {

    }
  },
  computed: {
    userInfo () {
      return this.$store.state.userInfo
    },
    isLogin () {
      return this.$store.state.isLogin
    }
  },
  methods: {
    login () {
      this.$router.push({ name: 'login' })
    }
  }
}
</script>

<style>
.el-container {
  height: 100%;
}

.el-header {
  height: 80px;
  background-color: white;
  line-height: 80px;
}

.el-header > span,
.el-header .el-dropdown {
  font-size: 18px;
}

.el-footer {
  background-color: #252d36;
  color: #ffc852;
  text-align: center;
  line-height: 60px;
}

.el-main {
  color: #333;
  text-align: center;
}
</style>
